package cn.edu.swu.film;

import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;
import java.io.Writer;
import java.sql.SQLException;

@WebServlet("/update1")
public class Update1 extends HttpServlet {

    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
        String id = request.getParameter("id");
        Film film = null;
        try {
            film = FilmRepo.getInstance().getById(id);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }

        String html = "./filmsave";
        response.setContentType("text/html; Charset=utf8");
        try (Writer writer = response.getWriter()) {
            writer.write(html);
        }
    }

}


